-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: [DHIS2-18325] Show orgunit selector in the new event form #3879
base: master
Are you sure you want to change the base?
feat: [DHIS2-18325] Show orgunit selector in the new event form #3879
Conversation
…_showOrgUnitSelectorInNewEventForm
🚀 Deployed on https://deploy-preview-3879.capture.netlify.dhis2.org |
…_showOrgUnitSelectorInNewEventForm
…_showOrgUnitSelectorInNewEventForm
const validatorContainers = [ | ||
{ | ||
validator: validateOrgUnit, | ||
message: i18n.t('Please provide an valid organisation unit'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use errorMessage
instead of message
, this way we sync with the work done in DHIS2-18325?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, that is a great idea!
{orgUnitName | ||
? i18n.t('Saving to {{stageName}} for {{programName}} in {{orgUnitName}}', | ||
{ orgUnitName, stageName, programName, interpolation: { escapeValue: false } }) | ||
: i18n.t('Saving to {{stageName}} for {{programName}}', | ||
{ stageName, programName, interpolation: { escapeValue: false } })} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I go to the new event page without having an org unit in ScopeSelector and select one in the form, the text at the bottom of the form does not reflect the selected orgUnit. Can you take a look at it?
Screen.Recording.2025-01-09.at.09.43.11.mov
Thanks!
@@ -17,6 +17,9 @@ const convertToClientCoordinates = ({ coordinates, type }: { coordinates: any[], | |||
|
|||
const getCenterPoint = (InnerComponent: ComponentType<any>) => (props: Object) => { | |||
const { orgUnit, ...passOnProps } = props; | |||
if (!orgUnit || !orgUnit.id) { | |||
return <InnerComponent {...passOnProps} center={DEFAULT_CENTER} onOpenMap={() => {}} />; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the center where the map opens change when a different orgUnit is selected?
Screen.Recording.2025-01-09.at.10.16.25.mov
@@ -96,9 +96,12 @@ export const useLifecycle = ({ | |||
]); | |||
|
|||
const rulesReady = | |||
(!orgUnit) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the orgUnit mandatory for the rules engine? Should we use &&
instead of ||
?
DHIS2-18325
Report tab
isReadOnly
prop to true.